package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import com.nineclock.system.dto.SysUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("sys-service")
public interface SysUserFeign {
    //注意：在feign接口中，get请求，参数必须加@RequestParam 注解 
    @GetMapping("/user/query")
    public Result<SysUserDTO> queryUser(@RequestParam("username") String username);

    @GetMapping("/companyUser/query")
    public Result<List<SysCompanyUserDTO>> queryCompanyUser(
            @RequestParam(value = "userId", required = false) Long userId,
            @RequestParam(value = "companyId", required = false )Long companyId);
}